import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../home.dart';
import '../../../../shared/shared.dart';

class EditWidget extends GetView<HomeLogic> {
  final String title;
  final String text;
  final bool showGender;

  const EditWidget(
      {Key? key,
      required this.text,
      required this.title,
      this.showGender = false})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      margin: const EdgeInsets.symmetric(horizontal: 40),
      child: Column(
        children: [
          CommonWidget.rowHeight(height: 10),
          Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Text(title,
                  style: const TextStyle(
                      color: ColorConstants.themeColor, fontSize: 16)),
              Text(text,
                  style: const TextStyle(
                      color: ColorConstants.themeColor,
                      fontSize: 16,
                      fontWeight: FontWeight.bold)),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  showGender
                      ? CommonWidget.rowWidth(width: 20)
                      : IconFont(
                          IconNames.edit,
                          size: 20,
                        ),
                  Text('编辑',
                      style: TextStyle(
                          color: showGender
                              ? Colors.transparent
                              : ColorConstants.themeColor,
                          fontSize: 14))
                ],
              )
            ],
          ),
          CommonWidget.rowHeight(height: 10),
          Container(
            child: CommonWidget.line(opacity: 0.60, thickness: 1),
          )
        ],
      ),
    );
  }
}
